require 'test/unit'
require 'url_parser'

class UrlParserTest < Test::Unit::TestCase
  def setup
  end
  def teardown
  end
  def test_parse
    p = UrlParser.new
    p.base_url = "http://www.hoge.com/"
    assert_equal(['aaa', 'bbb', 'ccc'], p.parse('http://www.hoge.com/aaa/bbb/ccc'))
    assert_raise(ArgumentError) { p.parse('http://www.foo.com/') }
    assert_raise(ArgumentError) { p.parse(' http://www.hoge.com/') }
  end
end

